package com.wdh.minio.web.controller;

import com.wdh.minio.service.OrderService;
import com.wdh.minio.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private TestService testService;

    @Autowired
    private OrderService orderService;

    @RequestMapping("/async1")
    public String async1(){
        testService.test1();
        return "async";
    }

    @RequestMapping("/async2")
    public String async2(){
        testService.test2("hello world");
        return "async";
    }

    @RequestMapping("/createOrder")
    public String createOrder(){
        orderService.createOrder();
        return "createOrder";
    }

    @RequestMapping("/payOrder")
    public String payOrder(){
        orderService.publishPayEvent();
        return "payOrder";
    }
}
